import type { RouteRecordRaw } from "vue-router";

/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/Login/login.vue"),
    meta: {
      showHead: false,
      title:'登录',
    },
  },
  {
    path: "/",
    name: "login",
    redirect: "/login",
  },
  {
    path: "/monitor",
    name: "MonitorMode",
    component: () => import("@/views/MonitorMode/monitormode.vue"),
    meta: {
      title:'监控模式',
      showHead: true,
      monitorMode:true,
      requiresAuth: true 
    },
  },
  {
    path: "/control",
    name: "ControlMode",
    component: () => import("@/views/ControlMode/controlmode.vue"),
    meta: {
      title:'控制模式',
      showHead: true,
      requiresAuth: true 
    },
  },
  {
    path: "/details/:id",
    name: "Details",
    component: () => import("@/views/Details/details.vue"),
    meta: {
      title:'设备详情',
      showHead: true,
      requiresAuth: true 
    },
  },
  {
    path: "/alarm",
    name: "Alarm",
    component: () => import("@/views/Alarm/alarm.vue"),
    meta: {
      title:'告警中心',
      showHead: true,
      requiresAuth: true 
    },
  },
  {
    path: "/three",
    name: "Three",
    component: () => import("@/views/Three/three.vue"),
    meta: {
      showHead: true,
      requiresAuth: true 
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/Error/404.vue"),
    meta: {
      showHead: false,
    },
  },
  {
    path: "/head",
    name: "Head",
    component: () => import("@/components/Head/head.vue"),
    meta: {
      requiresAuth: true 
    },
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("@/views/Home/home.vue"),
    meta: {
      title:'设备监控',
      showHead: true,
      controlMode:true,
      requiresAuth: true 
    },
  },

  /* 匹配任意的路由 必须最后注册 */
  {
    path: "/:pathMatch(.*)",
    name: "Any",
    redirect: "/404",
  },
];

/**
 * 定义动态路由
 */
export const allAsyncRoutes: Array<RouteRecordRaw> = [];
